package cn.iocoder.yudao.module.common.dal.mysql.gradesubjecttextbookversion;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.common.dal.dataobject.gradesubjecttextbookversion.GradeSubjectTextbookVersionDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.common.controller.admin.gradesubjecttextbookversion.vo.*;

/**
 * 年级学科版本 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface GradeSubjectTextbookVersionMapper extends BaseMapperX<GradeSubjectTextbookVersionDO> {

    default PageResult<GradeSubjectTextbookVersionDO> selectPage(GradeSubjectTextbookVersionPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<GradeSubjectTextbookVersionDO>()
                .eqIfPresent(GradeSubjectTextbookVersionDO::getTextbookVersionId, reqVO.getTextbookVersionId())
                .eqIfPresent(GradeSubjectTextbookVersionDO::getSubjectId, reqVO.getSubjectId())
                .eqIfPresent(GradeSubjectTextbookVersionDO::getGradeId, reqVO.getGradeId())
                .likeIfPresent(GradeSubjectTextbookVersionDO::getCreatorName, reqVO.getCreatorName())
                .betweenIfPresent(GradeSubjectTextbookVersionDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(GradeSubjectTextbookVersionDO::getUpdaterName, reqVO.getUpdaterName())
                .eqIfPresent(GradeSubjectTextbookVersionDO::getVersion, reqVO.getVersion())
                .orderByDesc(GradeSubjectTextbookVersionDO::getId));
    }

}